<?php 
// echo extension_loaded("GD"); //检测扩展库是否存在

header("Content-type: image/gif");
$src = imageCreateTrueColor(400,200);    //创建画布
$color = imageColorAllocate($src,255,255,255); //给画布设置颜色

$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));

for ($i=0; $i <6; $i++) { 
	$str = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
	$code = $str[mt_rand(0,strlen($str)-1)];

	$width = $i*90;

	$width+=20;

	$height = mt_rand(140,160);

	$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));
	imagettftext ($src, 100 , mt_rand(-30,30) ,$width ,$height,$color, './font411/FireBlock.ttf' , $code);
}
for ($i=0; $i <100; $i++) { 
	$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));
	imageline ( $src,mt_rand(0,400),mt_rand(0,200),mt_rand(50,200),mt_rand(50,200) , $color);
}
for ($i=0; $i <1000 ; $i++) { 
	$color = imageColorAllocate($src,mt_rand(0,255),mt_rand(0,255),mt_rand(0,250));
	imagesetpixel ( $src , mt_rand(0,400) , mt_rand(0,200) ,$color);
}


imagegif($src);


 ?>